// source --> https://sky3888-download.com/wp-content/plugins/jetpack/modules/related-posts/related-posts.js?ver=20150408 /* jshint onevar: false */ /* globals related_posts_js_options */ /** * Load related posts */ (function($) { var jprp = { response: null, /** * Utility get related posts JSON endpoint from URLs * * @param string URL (optional) * @return string endpoint URL */ getEndpointURL: function( URL ) { var locationObject = document.location; if ( 'string' === typeof( URL ) && URL.match( /^https?:\/\// ) ) { locationObject = document.createElement( 'a' ); locationObject.href = URL; } var args = 'relatedposts=1'; if ( $( '#jp-relatedposts' ).data( 'exclude' ) ) { args += '&relatedposts_exclude=' + $( '#jp-relatedposts' ).data( 'exclude' ); } var pathname = locationObject.pathname; if ( '/' !== pathname[0] ) { pathname = '/' + pathname; } if ( '' === locationObject.search ) { return pathname + '?' + args; } else { return pathname + locationObject.search + '&' + args; } }, getAnchor: function( post, classNames ) { var anchor_title = post.title; if ( '' !== ( '' + post.excerpt ) ) { anchor_title += '\n\n' + post.excerpt; } var anchor = $( '' ); anchor.attr({ 'class': classNames, 'href': post.url, 'title': anchor_title, 'rel': post.rel, 'data-origin': post.url_meta.origin, 'data-position': post.url_meta.position }); var anchor_html = $( '
' ).append( anchor ).html(); return [ anchor_html.substring( 0, anchor_html.length-4 ), '' ]; }, generateMinimalHtml: function( posts ) { var self = this; var html = ''; $.each( posts, function( index, post ) { var anchor = self.getAnchor( post, 'jp-relatedposts-post-a' ); var classes = 'jp-relatedposts-post jp-relatedposts-post' + index; if ( post.classes.length > 0 ) { classes += ' ' + post.classes.join( ' ' ); } html += '

'; html += ''; html += ''; html += ''; html += '

'; } ); return ''; }, generateVisualHtml: function( posts ) { var self = this; var html = ''; $.each( posts, function( index, post ) { var anchor = self.getAnchor( post, 'jp-relatedposts-post-a' ); var classes = 'jp-relatedposts-post jp-relatedposts-post' + index; if ( post.classes.length > 0 ) { classes += ' ' + post.classes.join( ' ' ); } if ( ! post.img.src ) { classes += ' jp-relatedposts-post-nothumbs'; } else { classes += ' jp-relatedposts-post-thumbs'; } html += '
'; if ( post.img.src ) { html += anchor[0] + '' + anchor[1]; } else { var anchor_overlay = self.getAnchor( post, 'jp-relatedposts-post-a jp-relatedposts-post-aoverlay' ); html += anchor_overlay[0] + anchor_overlay[1]; } html += '<' + related_posts_js_options.post_heading + ' class="jp-relatedposts-post-title">' + anchor[0] + post.title + anchor[1] + ''; html += '

' ).text( post.excerpt ).html() + '

'; html += ''; html += ''; html += '
'; } ); return ''; }, /** * We want to set a max height on the excerpt however we want to set * this according to the natual pacing of the page as we never want to * cut off a line of text in the middle so we need to do some detective * work. */ setVisualExcerptHeights: function() { var elements = $( '#jp-relatedposts .jp-relatedposts-post-nothumbs .jp-relatedposts-post-excerpt' ); if ( 0 >= elements.length ) { return; } var fontSize = parseInt( elements.first().css( 'font-size' ), 10 ), lineHeight = parseInt( elements.first().css( 'line-height' ), 10 ); // Show 5 lines of text elements.css( 'max-height', ( 5 * lineHeight / fontSize ) + 'em' ); }, getTrackedUrl: function( anchor ) { var args = 'relatedposts_hit=1'; args += '&relatedposts_origin=' + $( anchor ).data( 'origin' ); args += '&relatedposts_position=' + $( anchor ).data( 'position' ); var pathname = anchor.pathname; if ( '/' !== pathname[0] ) { pathname = '/' + pathname; } if ( '' === anchor.search ) { return pathname + '?' + args; } else { return pathname + anchor.search + '&' + args; } }, cleanupTrackedUrl: function() { if ( 'function' !== typeof history.replaceState ) { return; } var cleaned_search = document.location.search.replace( /\brelatedposts_[a-z]+=[0-9]*&?\b/gi, '' ); if ( '?' === cleaned_search ) { cleaned_search = ''; } if ( document.location.search !== cleaned_search ) { history.replaceState( {}, document.title, document.location.pathname + cleaned_search ); } } }; $( function() { jprp.cleanupTrackedUrl(); $.getJSON( jprp.getEndpointURL(), function( response ) { if ( 0 === response.items.length || 0 === $( '#jp-relatedposts' ).length ) { return; } jprp.response = response; var html = ''; if ( !response.show_thumbnails ) { html = jprp.generateMinimalHtml( response.items ); } else { html = jprp.generateVisualHtml( response.items ); } $( '#jp-relatedposts' ).append( html ); jprp.setVisualExcerptHeights(); $( '#jp-relatedposts' ).show(); $( '#jp-relatedposts a.jp-relatedposts-post-a' ).click(function() { this.href = jprp.getTrackedUrl( this ); }); } ); } ); })(jQuery); // source --> https://sky3888-download.com/wp-content/plugins/add-to-any/addtoany.min.js?ver=1.0 "function"==typeof jQuery&&jQuery(document).ready(function(a){a("body").on("post-load",function(){window.a2a&&a2a.init_all("page")})}); // source --> https://sky3888-download.com/wp-content/themes/enfold/js/avia-compat.js?ver=2 /* this prevents dom flickering for elements hidden with js, needs to be outside of dom.ready event.also adds several extra classes for better browser support this is a separate file that needs to be loaded at the top of the page. other js functions are loaded before the closing body tag to make the site render faster */ "use strict" var avia_is_mobile = false; if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && 'ontouchstart' in document.documentElement) { avia_is_mobile = true; document.documentElement.className += ' avia_mobile '; } else { document.documentElement.className += ' avia_desktop '; } document.documentElement.className += ' js_active '; (function(){ //set transform property var prefix = ['-webkit-','-moz-', '-ms-', ""], transform = ""; for (var i in prefix) { // http://artsy.github.io/blog/2012/10/18/so-you-want-to-do-a-css3-3d-transform/ if(prefix[i]+'transform' in document.documentElement.style) { document.documentElement.className += " avia_transform "; transform = prefix[i]+'transform'} if(prefix[i]+'perspective' in document.documentElement.style) document.documentElement.className += " avia_transform3d "; } //set parallax position to prevent jump at pageload if(typeof document.getElementsByClassName == 'function' && typeof document.documentElement.getBoundingClientRect == "function" && avia_is_mobile == false) { if(transform && window.innerHeight > 0) { setTimeout(function(){ var y = 0, offsets = {}, transY = 0, parallax = document.getElementsByClassName("av-parallax"), winTop = window.pageYOffset || document.documentElement.scrollTop; for (y = 0; y < parallax.length; y++) { parallax[y].style.top = "0px"; offsets = parallax[y].getBoundingClientRect(); transY = Math.ceil( (window.innerHeight + winTop - offsets.top) * 0.3 ); parallax[y].style[transform] = "translate(0px, "+transY+"px)"; parallax[y].style.top = "auto"; parallax[y].className += ' enabled-parallax '; } }, 50); } } })();